package com.execdemo.demomasterservice.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalTime;
import java.util.Date;

/**
 * @TableName store
 */
@TableName(value = "store")
@Data
@EqualsAndHashCode
public class Store implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     *
     */
    @ExcelProperty(value = "门店编码")
    private String code;

    /**
     *
     */
    @ExcelProperty(value = "门店名称")
    private String name;

    /**
     *
     */
    @ExcelProperty(value = "开店时间")
    private LocalTime openingTime;

    /**
     *
     */
    @ExcelProperty(value = "闭店时间")
    private LocalTime closingTime;

    /**
     *
     */
    @ExcelProperty(value = "门店承担优惠金额")
    private Float activeAccount;

    /**
     * 0-关闭、1-开启
     */
    @ExcelProperty(value = "优惠状态，0-关闭、1-开启")
    private Integer accountStatus;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Store other = (Store) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
                && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
                && (this.getOpeningTime() == null ? other.getOpeningTime() == null : this.getOpeningTime().equals(other.getOpeningTime()))
                && (this.getClosingTime() == null ? other.getClosingTime() == null : this.getClosingTime().equals(other.getClosingTime()))
                && (this.getActiveAccount() == null ? other.getActiveAccount() == null : this.getActiveAccount().equals(other.getActiveAccount()))
                && (this.getAccountStatus() == null ? other.getAccountStatus() == null : this.getAccountStatus().equals(other.getAccountStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getOpeningTime() == null) ? 0 : getOpeningTime().hashCode());
        result = prime * result + ((getClosingTime() == null) ? 0 : getClosingTime().hashCode());
        result = prime * result + ((getActiveAccount() == null) ? 0 : getActiveAccount().hashCode());
        result = prime * result + ((getAccountStatus() == null) ? 0 : getAccountStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", code=").append(code);
        sb.append(", name=").append(name);
        sb.append(", openingTime=").append(openingTime);
        sb.append(", closingTime=").append(closingTime);
        sb.append(", activeAccount=").append(activeAccount);
        sb.append(", accountStatus=").append(accountStatus);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}